<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>唉哟嘿</title>
	<link rel="stylesheet" href="../static/css/index.css">
	<script src="../static/js/jquery-3.2.1.min.js" type="text/javascript"></script>
	<script src="../static/js/common.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(function() { 

			 ajaxAction("http://localhost:8080/blog/getById");

	});
	 function ajaxAction(action){
		  $.ajax({
            type : "get",
            url : action,
            data :{},//设置数据源
            dataType : "json",//设置需要返回的数据类型
			success : function(result) {
				for (var i = 0; i < 3; i++) {
				var blogList = result[i];
				//加载博客
				$("#div-blog").append("<ul><li class='card_main_content'><a overflow=' hidden' id="
						+blogList.id+" ></a><a class='card_main_content_title' name='blog-title' id='blog-title' href='blogArticle.jsp?id="+blogList.id+"'>"
						+blogList.title+"</a><p class='card_main_content_section'>"
						+blogList.viceTitle+"</p><p class='card_main_content_footer'><span class='article_time'>"
						+formatDate(blogList.createTime)+"</span><span class='article_viewNum'>浏览量："
						+blogList.read+"次</span><a href='blogArticle.jsp?id="+blogList.id+"'>阅读全文>></a></p></li></ul>");
				}
				}
		  })
		}
	function onNotNull(index){
		if(index==1){
			$("#baidu").submit();
		}else if(index==2){
			$("#csdn").submit();
		}
	}
	</script>
</head>
<body>
	<!-- 头部页面 -->
	<jsp:include page="top.jsp" />
	<!-- 内容显示区 -->
	<div class="main_section">
		 <%--<jsp:include page="main-text.jsp" />--%>
		<div class="left_section">
			<div class="card_section">
				<div class="card_top">
					<span>个人博客</span>
					<a href="blog.jsp">查看更多>></a>
				</div>
				<div class="card_down" id="div-blog">
					<div id="div-blog2">
					</div>
				</div>
			</div>
			<div class="card_section">
				<div class="card_top">
					<span>开源项目</span>
					<a href="javascript:void(0)">查看更多>></a>
				</div>
				<div class="card_down">
					<ul>
						<li class="card_main_content">
							<a class="card_main_content_title">${blog}</a>
							<p class="card_main_content_section">帝文章，</p>
							<p class="card_main_content_footer"><span class="article_time">2018-09-07</span><span class="article_viewNum">浏览量：0次</span><a href="javascript:void(0)">阅读全文>></a></p>
						</li>
					</ul>
				</div>
			</div>
			

		</div>
		<div class="right_section">
			<div class="card_section">
				<h2 class="small_card_title">关于我</h2>
				<img src="../pic/head.jpg" alt="" class="author_pic">
				<div class="small_card_content">
					<p class="baseInfo">网名：幻凡SS</p>
					<p class="baseInfo">职业：Java小菜鸟</p>
					<p class="baseInfo">区域：魔都-上海</p>
					<p class="baseInfo" >邮箱：<a href="mailto:hfans@foxmail.com" title="请注明类型：">hfans@foxmail.com</a></p>
				</div>
			</div>
			<div class="card_section">
				<h2 class="small_card_title">搜索</h2>
				<div class="small_card_content">
					<div style='overflow:hidden'><!-- 百度搜索 -->
						<form  id = 'baidu' action="http://www.baidu.com/baidu" target="_blank" class="search_form">
							<input id ="baiduseach" class='search_text' type="text" name="word"  size="30" placeholder="请输入搜索内容" >
							<input class='search_btn' type="button" value="百度"  onclick="onNotNull('1');">
						</form>
						<form  id = 'csdn' action="http://so.csdn.net/so/search/s.do" target="_blank" class="search_form" >
							<input id ="csdnseach" class='search_text' type="text" name="q"  size="30" placeholder="请输入搜索内容" >
							<input class='search_btn search_CSDN' type="button" value="CSDN" onclick="onNotNull('2');" >
						</form>
					</div>
				</div>
			</div>
			<div class="card_section">
				<h2 class="small_card_title">公众号</h2>
				<div class="small_card_content">
					<img alt="" src="../pic/gongzhonghao.jpg">
				</div>
			</div>
			<div class="card_section">
				<h2 class="small_card_title">友情链接</h2>
				<div class="small_card_content">

				</div>
			</div>
			<%--<!-- 公众号 -->
			<div style="width:100%;height:50%;border: 1px solid #000">
				公众号图片
				公众号名字
			</div>
			<!-- 友链 -->
			<div style="width:100%;height:50%;border: 1px solid #000">
				友情链接地址
			</div>--%>
		</div>
	</div>
</body>
</html>